package com.situ.dao;

import com.situ.bean.Product;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
@Mapper
public interface ProductDao {


    List<Product> getAllProducts();
    Product  getProductById(@RequestParam int id);

    List<Product> getProductsByPage(@Param("limit") int limit, @Param("offset") int offset);
    int getTotalProducts();
    List<Product> searchProducts(@Param("query") String query);



    List<Product> filterProducts(
            @Param("categories") List<Integer> categories,
            @Param("minPrice") Double minPrice,
            @Param("maxPrice") Double maxPrice);


    List<Integer> findCategoryIdsByPids( @Param("categoryIds") List<Integer>  categoryIds);

    List<Product>  getAllofProducts();


}


